import 'package:flutter/material.dart';

class WeekImg extends StatelessWidget {
  const WeekImg({super.key, this.size = 116});
  final double size;

  // 获取当前星期数（1-7，周一到周日）
  int getCurrentWeekDay() {
    return DateTime.now().weekday;
  }

  // 根据星期数获取图片路径
  String getImagePath(int weekDay) {
    return "assets/images/week/${weekDay}.png";
  }

  @override
  Widget build(BuildContext context) {
    // 获取当前星期数
    int weekDay = getCurrentWeekDay();

    return Column(
      children: [
        Image.asset(
          getImagePath(weekDay), // 使用星期数来选择图片
          width: size,
        ),
        const Text(
          "卡通形象版权归原作者所有",
          style: TextStyle(fontSize: 5.7), // 调整字体大小以便阅读
        ),
      ],
    );
  }
}
